/* 
 * File:   DropDatabase.cpp
 * Author: vikrantsingh
 * 
 * Created on 4 December, 2013, 11:23 AM
 */

#include "DropDatabase.h"
#include "../BufferManager/BufferManager.h"

DropDatabase::DropDatabase() {
}

DropDatabase::DropDatabase(const DropDatabase& orig) {
}

DropDatabase::~DropDatabase() {
}

STATUS_CODE DropDatabase::run(QueryStructures *queryStruct){
    BufferManager *bm = BufferManager::getInstance();
    if(isDBOpen == true){
        bm->closeDB();        
    }
   int err= bm->dropDB(queryStruct->databaseName);
   if(err!=SUCCESS)
       return err;
   
   return SUCCESS;       
}